home *** CD-ROM | disk | FTP | other *** search
-
- Sorry for my english... but I'll try to make things clear.
-
- After an intensive discussion with other two physicist i found the answer
- to the elastic collision question.
- I assume that the masses of the cars are all equal for semplicity.
-
- Avoiding friction forces and however every kind of dissipative forces,
- what really is important is the momentum conservation and the kinetics
- energy.
- Now the result is that after an elastic collision between two boby of the
- same mass, their velocity is simply exchanged. You can see this with a
- billiard ball which strikes a static ball. After the collision the first
- "incoming" ball come to rest while the second escape with the velocity of
- the first ball. On a head on collision where both the ball move the
- second ball return with the velocity of the first and the first with the
- velocity of the second.
- So it mat all seem simple... but... what happen if it is not a head on
- collision? This is the problem (to be or not to be... ehmm...).
-
- The problem is more evident if your car are rectangular. In this case
- (excluding rotation movement, in which case you would need a second of
- your computer power to calculate the resulting movements!) the machines
- can collide also on sides.
-
- You should have four lines on each car which detect where the collision
- happens. This way you can easily calculate the relative velocity (that
- on axe X or on axe Y depending on the point of collision) which the car
- takes from the other car.
-
- So if you have a car which is moving north (1) and one which is moving west
- (2) and they collide you have to decide which is the "incoming" and which is
- the "target". This is easy... the "incoming" car is that which hits with
- the front of the car, while the "target" is that which is hit on the
- side or the back.
-
- Assume the car (2) is the "incoming" car and collide with (1).
- (1) is hit on the right side, while (2) hit with the front.
- Now car (2) stops moving completely (as there is not X velocity coming
- from car (1) ) while car (1) acquires the x velocity of car (2).
-
- You can apply friction after the collision which simply slow down car (1)
- skidding.
-
- The base formula of the collision is:
-
- V1i+V2i = V1f+V2f
-
- This means that the sum of the velocity before the collision and the
- sum of the resulting velocities after the collision are the same.
-
- All the example I have made follow this rule.
-
- Now friction.
- It is very simple as a formula, but i think it is quite complicated to
- insert in your game.
- If the cars are not subjected to an acceleration in a determined
- direction they must slow down on that direction. So after a head-side
- collision car (2) must slow down it's velocity on axe X.
-
- Friction formula is:
- F=-kM
- where M is the mass of the car and K a coefficient which determines the
- strenght of the force.
- You should have two friction forces. One for the back-front direction of
- the car and one for the left-right side direction of the car.
- The former should be smaller than the latter as the wheels help the car
- while the side movement are much more "dumped".
- The side force can be 20 times stronger than the back-head force.
-
- You can easily use the collision formulae for a car against a wall
- (letting the wall be completely rigid). The car simply is "reflected" by
- the wall. This follows the energy conservation rule.
-
- If you want to include car deformation you have to add a coefficient to
- the equations exchanging the velocity of the colliding objects.
- The coefficient should be a number < 1.
-
- This seems quite complicated, but I think it is not. Maybe the most
- difficult things is to trace the 4 lines on the cars which control
- collisions.
-
- Hope this vill help.
-
- M&F
-
- P.S. Sorry for my english, but if you could not understand something tell
- me. I will try to make it clearer.
-
-
-